'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    await ctx.service.home.index()
    const data = await this.app.mysql.select('users')
    // console.log('时间格式转换：', ctx.helper.relativeTime(1593244613))
    // console.log('密码加密', ctx.helper.getPassword(123))
    ctx.body = data;
  }

  async login() {
    let data = await this.ctx.service.home.login()
    this.ctx.body = data;
  }
}

module.exports = HomeController;
